package pc.sql;

import java.math.*;

public abstract class Column {
    protected String name;

    public Column(String name) {
      this.name = name;
    }

    public String getName() {
      return name;
    }

    public BigDecimal getBigDecimal() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to BigDecimal");
    }

    public boolean getBoolean() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to boolean");
    }

    public byte getByte() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to byte");
    }

    public byte[] getBytes() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to byte[]");
    }

    public java.sql.Date getDate() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to Date");
    }

    public double getDouble() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to double");
    }

    public float getFloat() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to float");
    }

    public int getInt() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to int");
    }

    public long getLong() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to long");
    }

    public short getShort() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to short");
    }

    /**
     * This method must be implemented by all subclasses.
     * All data types can be converted to a String.
     */
    public abstract String getString();

    public java.sql.Time getTime() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to Time");
    }

    public java.sql.Timestamp getTimestamp() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to Timestamp");
    }

    public Object getObject() throws UnsupportedConversionException {
      throw new UnsupportedConversionException("No conversion to Object");
    }

    public String toString() {
      return getString();
    }
}

